package com.shrct.businessprocess.purchase.impl;

import com.shrct.businessprocess.purchase.RCBasePurchaseOrder;
import com.shrct.businessprocess.purchase.RCPurchasePayRequest;
import com.shrct.businessprocess.purchase.impl.RCBasePurchasePayRequestImpl;
import com.shrct.businessprocess.purchase.proxy.RCPurchasePayRequestProxy;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@Entity
@DiscriminatorValue("RCPURCHASEPAYREQUEST_TYPE")
public class RCPurchasePayRequestImpl extends RCBasePurchasePayRequestImpl implements RCPurchasePayRequest {
  public RCPurchasePayRequestImpl() {
    super();
  }
  
  public RCPurchasePayRequestImpl(final RCBasePurchaseOrder purchaseOrder) {
    super( purchaseOrder);
    
  }
  
  public static RCPurchasePayRequest create(final RCBasePurchaseOrder purchaseOrder, final IObjectFactory objectFactory) {
    com.shrct.businessprocess.purchase.RCPurchasePayRequest rCPurchasePayRequest = new com.shrct.businessprocess.purchase.impl.RCPurchasePayRequestImpl(
    	purchaseOrder
    );
    objectFactory.create(rCPurchasePayRequest);
    return rCPurchasePayRequest;			
    
  }
  
  public static RCPurchasePayRequest createRCPurchasePayRequestImpl(final RCBasePurchaseOrder purchaseOrder, final IObjectFactory objectFactory, final Procedure1<RCPurchasePayRequest> init) {
    com.shrct.businessprocess.purchase.RCPurchasePayRequest rCPurchasePayRequest = new com.shrct.businessprocess.purchase.impl.RCPurchasePayRequestImpl(
    	purchaseOrder
    );
    objectFactory.create(rCPurchasePayRequest);
    init.apply(rCPurchasePayRequest);
    
    return rCPurchasePayRequest;			
    
  }
  
  public RCPurchasePayRequestProxy toProxy() {
    com.shrct.businessprocess.purchase.proxy.RCPurchasePayRequestProxy proxy = new com.shrct.businessprocess.purchase.proxy.RCPurchasePayRequestProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
